from launch import LaunchDescription
from launch_ros.actions import Node
import os
from ament_index_python.packages import get_package_share_directory
# launch two radar nodes with different namespaces and parameter files


def generate_launch_description():
    rgb_params = os.path.join(
        get_package_share_directory(
            "vaapi_decode"), "launch", "param.yaml"
    )
    infred_param = os.path.join(get_package_share_directory(
        "vaapi_decode"), "launch", "infred.yaml")

    node = Node(
        package="vaapi_decode", executable="decoder", namespace="rgb", parameters=[rgb_params], output="screen"
    )
    ifred = Node(package="vaapi_decode", executable="decoder",
                 namespace="infred", parameters=[infred_param], output="screen")

    launch_description = LaunchDescription([node, ifred])
    return launch_description
